package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.EExchangeCoinMapper;
import com.ruoyi.system.domain.api.EExchangeCoin;
import com.ruoyi.system.service.IEExchangeCoinService;

/**
 * 闪兑币种配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class EExchangeCoinServiceImpl implements IEExchangeCoinService 
{
    @Autowired
    private EExchangeCoinMapper eExchangeCoinMapper;

    /**
     * 查询闪兑币种配置
     * 
     * @param id 闪兑币种配置主键
     * @return 闪兑币种配置
     */
    @Override
    public EExchangeCoin selectEExchangeCoinById(Long id)
    {
        return eExchangeCoinMapper.selectEExchangeCoinById(id);
    }

    /**
     * 查询闪兑币种配置列表
     * 
     * @param eExchangeCoin 闪兑币种配置
     * @return 闪兑币种配置
     */
    @Override
    public List<EExchangeCoin> selectEExchangeCoinList(EExchangeCoin eExchangeCoin)
    {
        return eExchangeCoinMapper.selectEExchangeCoinList(eExchangeCoin);
    }

    /**
     * 新增闪兑币种配置
     * 
     * @param eExchangeCoin 闪兑币种配置
     * @return 结果
     */
    @Override
    public int insertEExchangeCoin(EExchangeCoin eExchangeCoin)
    {
        eExchangeCoin.setCreateTime(DateUtils.getNowDate());
        return eExchangeCoinMapper.insertEExchangeCoin(eExchangeCoin);
    }

    /**
     * 修改闪兑币种配置
     * 
     * @param eExchangeCoin 闪兑币种配置
     * @return 结果
     */
    @Override
    public int updateEExchangeCoin(EExchangeCoin eExchangeCoin)
    {
        return eExchangeCoinMapper.updateEExchangeCoin(eExchangeCoin);
    }

    /**
     * 批量删除闪兑币种配置
     * 
     * @param ids 需要删除的闪兑币种配置主键
     * @return 结果
     */
    @Override
    public int deleteEExchangeCoinByIds(Long[] ids)
    {
        return eExchangeCoinMapper.deleteEExchangeCoinByIds(ids);
    }

    /**
     * 删除闪兑币种配置信息
     * 
     * @param id 闪兑币种配置主键
     * @return 结果
     */
    @Override
    public int deleteEExchangeCoinById(Long id)
    {
        return eExchangeCoinMapper.deleteEExchangeCoinById(id);
    }
}
